package cn.edu.sjtu.process_management.constant;

import lombok.AccessLevel;
import lombok.Getter;

/**
 * @author loumoon
 * @date 2019-11-01 15:07
 */
@Getter(AccessLevel.PUBLIC)
public enum RespStatus {
    SUCCESS("200", "请求成功"),

    REQUEST_NOT_FROM_GATEWAY("300", "请求并非来自网关"),
    DUPLICATED_PROCESS_NAME("350", "用户创建的流程名重复"),
    NON_AUTHORITY_UPDATE_PROCESS("351", "用户无权修改该流程"),
    NON_AUTHORITY_TO_PROCESS("352", "用户无权查看该流程"),
    NON_AUTHORITY_EXECUTE_PROCESS("352", "用户无权运行该流程"),
    NON_EXIST_PROCESS("353", "不存在的流程"),
    NON_MICRO_SERVICE_INSTANCE("354", "该微服务无可用实例"),
    FAIL_START_ECN("355", "开启ECN微服务失败"),
    FAIL_DETECT_ECN("356", "监控ECN微服务状态失败"),
    ERROR_RESPONSE_FROM_ECN("357", "错误的ECN微服务响应"),
    NON_EXIST_HISTORY("358", "不存在的流程运行记录"),
    NON_AUTHORITY_TO_HISTORY("359", "用户无权查看该流程运行状态"),
    INCORRECT_BPMN_FORMAT("360", "不正确的BPMN模型"),
    INCORRECT_START_NODE_NUMBER("361", "不正确的开始节点数目"),
    INCORRECT_END_NODE_NUMBER("362", "不正确的结束节点数目"),
    NON_VALUE_FOR_GATEWAY_BRANCH("363", "异或网关分支未添加判断值"),

    SERVER_ERROR("400", "服务器错误"),
    BPMN_PROCESS_PARSE_ERROR("401", "BPMN流程解析出错"),
    BPMN_PROCESS_EXECUTE_ERROR("402", "BPMN流程执行出错"),

    OPERATOR_SET_NOT_FOUND("404", "用户无ECN服务"),
    OPERATOR_SET_ERROR("500", "ECN请求错误"),


    UNKNOWN_ERROR("500", "未知错误");


    private String code;
    private String message;

    RespStatus(String code, String message) {
        this.code = code;
        this.message = message;
    }
}

